{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "aa637d8c-7c9c-4f8b-814a-92c21d94b29a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "请输入一个字符串: r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[114]\n"
     ]
    }
   ],
   "source": [
    "def main():\n",
    "    s = input(\"请输入一个字符串:\")\n",
    "    output = []\n",
    "    for i in range(len(s)):\n",
    "        num = ord(s[i])\n",
    "        output.append(num)\n",
    "    print(output)\n",
    "\n",
    "main()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8e2dfce9-a96b-47e8-8d29-cdbba304c2f7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
